package chpt01;

import java.util.Scanner;
import java.lang.String;
import java.lang.Integer;

public class TakeNumbers {
	
    public static void main(String[] args) {
    	
		Scanner input = new Scanner(System.in);
		while(input.hasNext()){
			String in=input.next();
		    int x = Integer.parseInt(in,10);
			if(x>=10000&&x<=20000){
				System.out.print(Integer.toBinaryString(x)+",");	
				System.out.print(Integer.toOctalString(x)+",");
				System.out.println(Integer.toHexString(x));
			}
			else{
				char ch[]=in.toCharArray();
		        for(int i=0;i<ch.length;i++){
		        	if(ch[i]>='0'&&ch[i]<='9'){
		        		System.out.print(ch[i]+" ");
		        	}
		        }
		        int sum=0;
		        x=x>0?x:-x;
		        while(x!=0){
		        	int a=x%10;
		        	sum=sum+a;
		        	x=x/10;
		        }
		        System.out.println(sum);  
			}
			input.close();
		}
	}
}